﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using TimerTask.Bll;

// For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860

namespace TimerTask.Web.Controllers
{
    public class HomeController : BaseController
    {
        // GET: /<controller>/
        public IActionResult Index()
        {
            return View();
        }

        public IActionResult Main()
        {
            var bll = new JobBll();
            Tuple<string, string, string> counts = bll.GetCounts();

            ViewBag.JobCount = counts.Item1;
            ViewBag.JobRunningCount = counts.Item2;
            ViewBag.AlarmCount = counts.Item3;

            ViewBag.FailLog = bll.GetFailLog();

            return View();
        }
    }
}
